const { Message } = require('../../model/message');
module.exports = async (req,res)=>{
  let message = await Message.findOne({_id: req.query.id});
  if (message){
    await Message.findByIdAndDelete(req.query.id);
    res.redirect('/admin/message');
  }else{
    res.render('admin/messageList',{
      message: '删除失败！！！'
    });
  }
}